/**
 * 
 */
package com.local.guava.compare;

import com.google.common.collect.ComparisonChain;

/**
 * @author admin
 *
 */

public class Girl implements Comparable<Girl>{
	private String name;
	private Double height;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Double getHeight() {
		return height;
	}

	public void setHeight(Double height) {
		this.height = height;
	}

	public Girl(String name, Double height) {
		super();
		this.name = name;
		this.height = height;
	}

	@Override
	public int compareTo(Girl girl) {	//guava	的代码非常简洁ComparisonChain.start()
		return ComparisonChain.start().compare(name, girl.name).compare(height, girl.height).result();
	}

	
}